-- CALC_USER_BASE_ATTRIB

--------------------- 此公式不用了，见interfaceM.calcBaseAttrib

-- 计算基础属性
-- @param user      玩家对象
-- @param attrib    属性
return function(user)
    -- 清空所有buff、debuff、special
    local prop = user.dbase:queryTemp("prop") or {};
    local propBuff = prop.buff or {};
    local propDebuff = prop. debuff or {};
    local propSpecial = prop.special or {};
    PropM.deleteProp(user, "buff");
    PropM.deleteProp(user, "debuff");
    PropM.deleteProp(user, "special");

    -- 基础屬性
    local attack = user:getAttack();
    local magic = user:getMagic();
    local maxHp = user:getMaxHp();
    local maxMp = user:getMaxMp();

    -- 有状态的附加回去
    if #propBuff > 0 then
        -- 用通用接口记录
        PropM.multiRecord(user, propBuff, "buff");
    end
    if #propDebuff > 0 then
        -- 用通用接口记录
        PropM.multiRecord(user, propDebuff, "debuff");
    end
    if #propSpecial > 0 then
        -- 用通用接口记录
        PropM.multiRecord(user, propSpecial, "special");
    end

    return { ["attack"] = attack,
             ["magic"] = magic,
             ["max_hp"] = maxHp,
             ["max_mp"] = maxMp, };
end
